<?php 
/**
 * Tutorial-View: `edit`
 *
 * PHP versions 4 and 5
 *
 * TutoriumBase (http://tutoriumbase.my-reality.de)
 * Copyright 2012, Miguel Gonzalez (http://my-reality.de)
 *
 *
 * @copyright     Copyright 2012, Miguel Gonzalez (http://my-reality.de)
 * @link          http://tutoriumbase.my-reality.de TutoriumBase
 * @since         TutoriumBase v 0.1
 */
echo '<div class="box">';
$options = array();

if (isset($caption)) {
  echo $this->Layout->generateMainCaption($caption);
}

foreach ($categories as $category)
{
   $options[$category['Category']['id']] = $category['Category']['name']; 
}
echo $this->Form->create('Tutorial', array('controller' => 'tutorials', 'action' => 'edit'));
echo $this->Form->input('id', array('type' => 'hidden'));
echo $this->Form->input('caption', array('type' => 'text', 'label' => 'Bezeichnung des Tutorials'));
echo $this->Form->input('user_id', array('type' => 'hidden'));
echo $this->Form->input('description', array('type' => 'textarea', 'label' => 'Beschreibung'));
echo $this->Form->input('category', array('label' => 'Kategorie', 'options' => $options));
echo $this->Form->submit('Bearbeiten', array('class' => 'button_green form_button'));
echo $this->Form->end();
echo '</div>';